<template>
  <div>
    <h1>树形演示</h1>
    <el-tree :data="treeData" default-expand-all>
      <template v-slot="scope">
        部门名称: {{ scope.data.name }} 负责人: {{ scope.data.manager }}
      </template>
    </el-tree>
  </div>
</template>

<script>
export default {
  data() {
    return {
      treeData: [
        {
          name: '总裁办',
          manager: '小王'
        },
        {
          name: '人事部',
          manager: '小陈'
        },
        {
          name: '技术部',
          manager: '小梁',
          children: [
            {
              name: '前端开发',
              manager: '小李'
            },
            {
              name: '后端开发',
              manager: '小张'
            }
          ]
        },
        {
          name: '市场部',
          manager: '小何'
        }
      ]
    }
  }
}
</script>

<style>

</style>
